import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Index from '../views/Index/Index.vue'
import Primary from '../views/Primary/Primary.vue'
import About from '../views/About/About.vue'
import Message from '../views/Message/Message.vue'
import News from '../views/News/News.vue'
import Next from '../views/Detail/Nextnews.vue'
import Connact from '../views/Connact/Connact.vue'
import Detail from '../views/Detail/Detail.vue'

Vue.use(VueRouter)

const routes = [
  {path:'/',redirect:'/index'},
  {path:'/index',component:Index},
  {
    path: '/home',
    redirect:'/home',
    component: Home,
    children:[
      {path:'/index',component:Index},
      {path:'/primary',component:Primary},
      {path:'/detail',component:Detail},
      {path:'/about',component:About},
      {path:'/message',component:Message},
      {path:'/next',component:Next},
      {path:'/news',component:News},
      {path:'/connact',component:Connact}
    ]
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
